#ifndef BLOCK_H_
#define BLOCK_H_

#include "mpi.h"

class Block {
public:
    virtual void startDownloading(int slave_source);
    virtual void waitForDownloadCompletion();
    virtual bool isDownloaded();
    
    virtual void sendDataTo(int slave_id);
    
    virtual int getId() { return id; }
    virtual void dispose() = 0;
    
protected:
    virtual void* getRawDataBuffer() = 0;
    virtual int getRawDataSize() = 0;
    virtual MPI_Datatype getDataType() = 0;
    
    
    MPI_Request request;
    MPI_Status status;
    int flag;
    int id;
};

#endif
